    $( function() {
        $("button[data-href]").click( function() {
            location.href = $(this).attr("data-href");
        });
    });

   function logout(){
       $.post('/logout',{}
           ,function(result){

               if (result.success){
                   window.location = '/'
               }

           },'json');
   }